<include file="Public:header" />
<load href="__JS__/upload/uploadify.css" />
<load href="__JS__/swfobject.js" />
<script type="text/javascript" src="__JS__/jquery.uploadify.v2.1.4.min.js"></script> 
<script type="text/javascript" src="__JS__/jianfanzhuanhuan.js"></script>
<div class="content">
<!-----------------------------------------内容开始--------------------------------------------------->
<div class="infoBox">
<form name="form" action="{:U('dogg_lbimg')}" method="post" onsubmit="return checkform();">
<input type="hidden" name="id" value="{$id}" />

<table width="100%" border="0" cellpadding="0" cellspacing="0" id="basic">

<tr>
	<td class="infoBoxTd">选择广告位：</td>
	<td colspan="2">
		<select name="wid">
			<option value="0">请选择</option>
			<volist name="wz" id="wz">
			<option value="{$wz.id}" <eq name="wz.id" value="$wid"> selected="selected" </eq> >{$wz.name}</option>
			</volist>
		</select>
	</td>
</tr>

<tr>
	<td width="11%" class="infoBoxTd">标题：</td>
	<td colspan="2">
		<INPUT name="name" value="{$name}" class="formTitle xzzsinput" size="80" maxlength="40" onkeyup="word_count(40,this)" onblur="auto_save('name')" >您已输入<span class="fred ysrzs">0</span>字，还可输入<span class="fred syzs">40</span>字。
		<br />
		<a href="javascript:;" onclick="zhuanjft(this)" class="buttom" style="margin-top:5px;"  >自动转换简繁体</a>
	</td>
</tr>
<volist name="lang_name" id="lang_name">
<tr>
	<td width="11%" class="infoBoxTd">标题（<span class="lang_name" lang_daihao="{$lang_name.nid}">{$lang_name.name}</span>）：</td>
	<td colspan="2">
		<input type="text" name="name{$lang_name.id}" value="{$lang_name.menu_name}" class="formTitle xzzsinput" size="80" maxlength="40" onkeyup="word_count(40,this)" onblur="auto_save('name{$lang_name.id}')" style="float:left;margin-right:10px;" />您已输入<span class="fred ysrzs">0</span>字，还可输入<span class="fred syzs">40</span>字。
		<br />
		<eq name="lang_name.nid" value="L01"> <a href="javascript:;" onclick="zhuanft(this)" class="buttom" style="margin-top:5px;"  >将简体转换为繁体</a></eq>
	</td>
</tr>
</volist>

<tr>
	<td class="infoBoxTd">图片：</td>
	<td colspan="2">
		<img id="img" src="<neq name='img' value=''>{$img}<else/>__PUBLIC__/images/nopic.gif</neq>" width="280"  style="float:left;margin-right:20px;" />
		<div class="upimg-box">
			<div id="fileQueue"></div>
			<input id="file_upload_img" type="file" /><input name="img" type="hidden" value="{$img}" />
		</div>
		<a href="javascript:;" onclick="fuzhisuoyou_img(this)" class="buttom" style="margin-top:10px;"  >复制到所有</a>
	</td>
</tr>
<script>
//图片上传
$("#file_upload_img").uploadify({
		'uploader'       : '__JS__/swf/uploadify.swf',
		'script'         : '__JS__/upload/uploadifywushuiyinsuolue.php',
		'cancelImg'      : '__JS__/upload/cancel.png',
		'folder'         : 'data/gg_lbimg_img',
		'queueID'        : 'fileQueue',
		'sizeLimit'      :	2 * 1000 * 1024,
		'fileExt'        : '*.jpg;*.gif;*.png;', //允许文件上传类型,和fileDesc一起使用.
		'fileDesc'       : '*.jpg;*.gif;*.png;',  //选择文件对话框中的提示文本.
		'auto'           : true,
		'multi'          : false,	
		'onComplete':function(event,queueId,fileObj,response,data){
			$('input[name="img"]').val(response);
			$('#img').attr('src', response);
		}
});

</script>
<volist name="lang_img" id="lang_name">
<tr>
	<td width="11%" class="infoBoxTd">图片（<span class="lang_name" lang_daihao="{$lang_name.nid}">{$lang_name.name}</span>）：</td>
	<td colspan="2">
		<img id="img{$lang_name.id}" src="<neq name='lang_name.menu_img' value=''>{$lang_name.menu_img}<else/>__PUBLIC__/images/nopic.gif</neq>" width="380" height="100" style="float:left;margin-right:20px;" />
		<div class="upimg-box">
			<div id="fileQueue{$lang_name.id}"></div>
			<input id="file_upload_img{$lang_name.id}" type="file" /><input name="img{$lang_name.id}" type="hidden" value="{$lang_name.menu_img}"  class="suoyou_img" />
		</div>
	</td>
</tr>
<script>
//图片上传
$("#file_upload_img{$lang_name.id}").uploadify({
		'uploader'       : '__JS__/swf/uploadify.swf',
		'script'         : '__JS__/upload/uploadifywushuiyinsuolue.php',
		'cancelImg'      : '__JS__/upload/cancel.png',
		'folder'         : 'data/gg_lbimg_img',
		'queueID'        : 'fileQueue{$lang_name.id}',
		'sizeLimit'      :	2 * 1000 * 1024,
		'fileExt'        : '*.jpg;*.gif;*.png;', //允许文件上传类型,和fileDesc一起使用.
		'fileDesc'       : '*.jpg;*.gif;*.png;',  //选择文件对话框中的提示文本.
		'auto'           : true,
		'multi'          : false,	
		'onComplete':function(event,queueId,fileObj,response,data){
			$('input[name="img{$lang_name.id}"]').val(response);
			$('#img{$lang_name.id}').attr('src', response);
		}
});
</script>
</volist>

<script type="text/javascript">

//复制图片到所有
function fuzhisuoyou_img(obj){
	var str=$(obj).parent().find("img").attr("src");
	$("input.suoyou_img").each(function(){
		$(this).val(str);
		$(this).parent().parent().find("img").attr("src",str);
	});
}

</script>


<tr>
	<td class="infoBoxTd">链接地址：</td>
	<td colspan="2">
	<INPUT name="url" value="{$url}" class="formTitle" size="80"  onblur="auto_save('url')" >
	<br />
	链接地址输入完整网址，例如“http://www.qq.com/”
	</td>
</tr>

<tr>
	<td width="11%" class="infoBoxTd">所属网站：</td>
	<td colspan="2">
		<select name="webid">
			<volist name="webs" id="webs">
			<option value="{$webs.id}" <eq name="webs.id" value="$webid">selected</eq>>{$webs.name}</option>
			</volist>
		</select>
	</td>
</tr>

<tr>
	<td width="11%" class="infoBoxTd">排序：</td>
	<td colspan="2"><input type="text" name="xu" value="{$xu}" />
	</td>
</tr>

</table>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="infoBoxTd">&nbsp;</td>
<td align="left">
	<php>
	if(!$state){
	</php>
		<input type="submit" name="Button1" value="提交审核" class="formInput01" />
	<php>
	}else{
	</php>
		<input type="submit" name="Button1" value="保存" class="formInput01" />
	<php>
	}
	</php>
</td>
</tr>
</table>
</form>
</div>
<!-----------------------------------------内容结束--------------------------------------------------->
</div>
<script language="javascript">

//表单验证
function checkform(){
	var n = $('input[name="url"]').val();
	if(n == ''){
		ui.error('请输入链接地址');
		return false;
	}

	var w = $('select[name="wid"]').val();
	if(w == 0){
		ui.error('请选择排数');
		return false;
	}

}

</script>
    

<include file="Public:footer" />
